package com.youseu.taoliving.commodity.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.youseu.common.utils.PageUtils;
import com.youseu.taoliving.commodity.entity.AttrAttrgroupRelationEntity;
import com.youseu.taoliving.commodity.entity.AttrEntity;

import java.util.List;
import java.util.Map;

/**
 * 商品属性表
 *
 * @author tao
 * @email tao@gmail.com
 * @date 2024-08-04 12:07:28
 */
public interface AttrService extends IService<AttrEntity> {

    PageUtils queryPage(Map<String, Object> params);
    //根据查询条件进行查询 支持name categoryId
    PageUtils queryBasePage(Map<String, Object> params,Long categoryId);
    PageUtils querySalesPage(Map<String, Object> params,Long categoryId);

    void saveAttrAndRelation(AttrEntity attrEntity);

    //根据属性组id 返回对应基本属性
    List<AttrEntity> getRelationAttr(Long attrgroupId);

    //删除已经关联的属性(支持批量删除)
    void deleteBatchRelation(AttrAttrgroupRelationEntity[] relationEntities);

    //获取可关联属性
    PageUtils getAllowRelationAttr(Map<String,Object> params,Long attrGroupId);
}

